//
//  WBDemoViewController.swift
//  DLSwift微博
//
//  Created by 丁浪涛 on 2016/11/8.
//  Copyright © 2016年 丁浪涛. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func  viewDidLoad() {
        super.viewDidLoad()
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个"
    }
    
    @objc fileprivate func showNext(){
    
        let vc = WBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    
    }

}

extension WBDemoViewController
{

    
    override func setUpTableView() {
        super.setUpTableView()
              navItem.rightBarButtonItem = UIBarButtonItem(tite: "下一个", fontSize: 12, target: self, action: #selector(showNext))
    }
    
//    
//    override func setupUI()
//    {
//        super.setupUI()
////        let btn :UIButton  =  UIButton.cz_textButton("下一个", fontSize: 12, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
////        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
////        navigationItem.rightBarButtonItem =     UIBarButtonItem(customView: btn)
////        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        
////        重构后的UIBarButtonItem
//        
//          navItem.rightBarButtonItem = UIBarButtonItem(tite: "下一个", fontSize: 12, target: self, action: #selector(showNext))
//    }
}
